import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025-03-07
 * Time: 18:53
 */
public class main1 {
    public static int[] transform(int[] array){
        for (int i = 0; i < array.length; i++) {
            array[i] = array[i] * 2;
        }
        return array;
    }
    public static void main(String[] args) {
        //实现一个方法 transform, 以数组为参数, 循环将数组中的每个元素乘以2,并设置到对应的数组元素上.例如 原数组为 {1,2,3},修改之后为 {2,4,6}
        int[] array = {1,2,3};
        System.out.println(Arrays.toString(array));
        System.out.println(Arrays.toString(transform(array)));
    }
}